package com.huaxin.device.dto.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.huaxin.device.dto.request.base.BasePageReqDTO;
import com.huaxin.hxenum.validation.ValidDataQuality;
import com.huaxin.hxenum.validation.ValidDataType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = true)
public class CollectedDataRecordPageListReqDTO extends BasePageReqDTO {

    @Schema(description = "采集设备ID", example = "collector-001")
    private String collectorId;

    @Schema(description = "设备序列号", example = "SN123456789")
    private String deviceSerial;

    @Schema(description = "电力设备ID", example = "equip-001")
    private String equipmentId;

    @Schema(description = "指标编码", example = "100001")
    private String metricCode;

    @Schema(description = "值类型过滤", example = "number")
    @ValidDataType
    private String valueType;

    @Schema(description = "数据质量过滤", example = "normal")
    @ValidDataQuality
    private String quality;

    @Schema(description = "开始采集时间", example = "2025-04-05 00:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime collectedAtStart;

    @Schema(description = "结束采集时间", example = "2025-04-05 23:59:59")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime collectedAtEnd;

    @Schema(description = "关键字搜索（匹配 dataName 或 description）")
    private String keyword;
}